home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / vlapak1.zip / VERTSCR.ZIP / VSCR4.ASM < prev    next >
Assembly Source File  |  1993-07-24  |  4KB  |  192 lines

  1. ;                         Written By Draeden of VLA
  2. ────────────────────────────────────────────────────────────────────────────
  3.     IDEAL
  4.     DOSSEG
  5.     MODEL SMALL
  6.     STACK 400h
  7.     CODESEG
  8.     P386
  9. ────────────────────────────────────────────────────────────────────────────
  10. INCLUDE "modex.inc"
  11.  
  12. MaxColor    =   230
  13.  
  14. INCLUDE "MXfont2.INC"
  15. SCRW = 80
  16. TxtHeight   =   8+4
  17.  
  18. NewLineData =   65535/SCRW - TxtHeight      ;where the next line is put (#)
  19. NewLineOff  =   NewLineData*SCRW
  20.  
  21. CurOff      dw  0                               ;current starting offset
  22. MaxOff      =   MaxColor*SCRW
  23.  
  24. CurCopy     dw  0
  25. MaxCopy     =   TxtHeight * SCRW
  26.  
  27. CurLine     db  1       ;from 1 to MaxColor
  28.  
  29. NUMPAL      =   15
  30. CHG         =   3
  31.  
  32. LABEL TopPal BYTE     
  33.     i= 0
  34.     REPT NUMPAL+1
  35.         db  i,i/3,i/2
  36.         i=i+CHG
  37.     ENDM
  38.  
  39. LABEL BotPal BYTE     
  40.     REPT NUMPAL+1
  41.         db  i,i/3,i/2
  42.         i=i-CHG
  43.     ENDM
  44. ────────────────────────────────────────────────────────────────────────────
  45. Msg1        db  1,RED,"Without ",1,GREEN,"the shading,",1,BLUE," you can "
  46.             db  1,GREY2,"color!",0
  47. Msg2        db  1,RED,"│Test #2 │",0
  48. Msg3        db  1,BLUE,"│Test #3 │",0
  49. Msg4        db  1,GREEN,"│Blah #4 │",0
  50. Msg5        db  1,GREY2,"│NYUK #5 │",0
  51. Msg6        db  1,RED2,"│Test #6 │",0
  52. Msg7        db  "│Ug.  #7 │",0
  53.  
  54. NumMsgs     =   8
  55.  
  56. MsgOffs     dw  offset Msg1, offset Msg2, offset Msg3, offset Msg4
  57.             dw  offset Msg5, offset Msg6, offset Msg7, offset TitleMsg
  58. CurMsg      dw  0
  59.  
  60. TitleMsg    db  1,BLUE,"This was coded by ",1,RED,"Draeden",1,BLUE," of ",1,RED,"VLA",0
  61. ────────────────────────────────────────────────────────────────────────────
  62. PROC ScrollDown
  63.     pusha
  64.     push    es ds
  65.     mov     es,[cs:VGAseg]
  66.     mov     ds,[cs:VGAseg]
  67.  
  68.     mov     ah,1
  69.     @Set_Write_Mode
  70.     mov     ah,1111b
  71.     @Set_Write_Plane
  72.  
  73.     inc     [cs:CurLine]
  74.     cmp     [cs:CurLine],MaxColor
  75.     jbe     @@ok
  76.     mov     [cs:CurLine],1
  77. @@Ok:
  78.  
  79.     mov     di,[cs:CurOff]
  80.     mov     bx,di
  81.     add     bx,SCRW
  82.     cmp     bx,MAXOFF
  83.     jb      @@COOK
  84.     xor     bx,bx
  85. @@COOK:
  86.     mov     [cs:CurOff],bx
  87.     add     di,(240-MaxColor)*SCRW + SCRW*2 ;cause of the extra line in the 
  88.     add     bx,(240-MaxColor)*SCRW + SCRW*2 ; split screen
  89.     
  90.     @Set_Start_Offset
  91.     @FullVertWait
  92.  
  93.     push    di
  94.  
  95.     mov     si,NewLineOff
  96.     add     si,[cs:CurCopy]
  97.     push    si
  98.     mov     cx,80
  99.     rep movsb
  100.     
  101.     pop     si
  102.     pop     di
  103.  
  104.     add     di,MaxColor*SCRW
  105.     mov     cx,80
  106.     rep movsb
  107.  
  108.     mov     ax,[cs:CurCopy]
  109.     add     ax,SCRW
  110.     cmp     ax,MaxCopy
  111.     jb      @@Cok
  112.     call    PutNextMsg
  113.     xor     ax,ax
  114. @@Cok:
  115.     mov     [cs:CurCopy],ax
  116.  
  117.     pop     ds es
  118.     popa
  119.     ret
  120. ENDP
  121.     ;es = VGAseg
  122. PROC PutNextMsg
  123.     pusha
  124.     push    ds
  125.     mov     ax,cs
  126.     mov     ds,ax
  127.  
  128.     mov     ah,1111b
  129.     @Set_Write_plane
  130.     mov     di,NewLineOff
  131.     xor     ax,ax
  132.     mov     cx,SCRW*TxtHeight
  133.     rep stosb
  134.     
  135.     mov     ah,0
  136.     @Set_Write_Mode
  137.     
  138.     mov     di,NewLineData
  139.     xor     ax,ax
  140.     mov     si,[CurMsg]
  141.     mov     si,[si + MsgOffs]
  142.     mov     cl,[CurLine]
  143.     call    PrintText
  144.  
  145.     add     [CurMsg],2
  146.     cmp     [CurMsg],NumMsgs*2
  147.     jb      @@noResetMsg
  148.     mov     [CurMsg],0
  149. @@noResetMsg:
  150.     pop     ds
  151.     popa
  152.     ret
  153. ENDP
  154. ────────────────────────────────────────────────────────────────────────────
  155. START:
  156.     mov     ax,cs
  157.     mov     ds,ax
  158.     mov     es,ax
  159.  
  160.     call    StealFont
  161.  
  162.     @SetModeX m320x240x256, 320
  163.  
  164.     mov     bx,MaxColor * 2 - 4
  165.     @Set_Split
  166.  
  167.     call    SetDefPal
  168.  
  169.     mov     cl,MaxColor + 1
  170.     mov     si,offset TitleMsg
  171.     mov     di, 0
  172.     mov     ax, 0
  173.     call    PrintText
  174.  
  175. @@MainLoop:
  176.     call    ScrollDown
  177.  
  178.     mov     ah,1
  179.     int     16h
  180.     jz      @@MainLoop
  181.  
  182.     mov     ah,0
  183.     int     16h
  184.  
  185.     mov     ax,3
  186.     int     10h
  187.  
  188.     mov     ax,4c00h
  189.     int     21h
  190. END START
  191.  
  192.